import {API} from '@/utils/axios'

export const createModel = (params: any) => {
    return API.post('/api/add/models', params)
}

export const updateModel = (params: any) => {
    return API.post(`/api/update/models/${params.id}`, params)
}

export const executeModel = (params: any) => {
    return API.post(`/api/execute/models/${params.id}`, params)
}


export const validateModelName = (params: any) => {
    return API.post('/api/validate/model-names', params)
}

export const validateModelTableName = (params: any) => {
    return API.post('/api/validate/model-table-names', params)
}

export const pageModel = (params: any) => {
    return API.get('/api/page/models', {params})
}

export const getModel = (params: any) => {
    return API.get(`/api/info/models/${params.id}`)
}
